﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;
using XCode.Configuration;
using XCode.DataAccessLayer;


namespace BingZi.HY.Core
{
    /// <summary>地区信息</summary>
    [Serializable]
    [DataObject]
    [Description("地区信息")]
    [BindIndex("PK_app_AreaData", true, "A_Id")]
    [BindTable("app_AreaInfo", Description = "地区信息", ConnName = "Center")]
    public partial class app_AreaInfo<TEntity> : Iapp_AreaInfo
    {
        #region 属性
        private Int32 _A_Id;
        /// <summary>编号</summary>
        [DisplayName("编号")]
        [Description("编号")]
        [DataObjectField(true, true, false, 10)]
        [BindColumn(1, "A_Id", "编号", null, "int", 10, 0, false)]
        public Int32 A_Id
        {
            get { return _A_Id; }
            set { if (OnPropertyChanging("A_Id", value)) { _A_Id = value; OnPropertyChanged("A_Id"); } }
        }

        private Int32 _A_ParentID;
        /// <summary>上级编号</summary>
        [DisplayName("上级编号")]
        [Description("上级编号")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(2, "A_ParentID", "上级编号", "0", "int", 10, 0, false)]
        public Int32 A_ParentID
        {
            get { return _A_ParentID; }
            set { if (OnPropertyChanging("A_ParentID", value)) { _A_ParentID = value; OnPropertyChanged("A_ParentID"); } }
        }

        private String _A_Name;
        /// <summary>地区名</summary>
        [DisplayName("地区名")]
        [Description("地区名")]
        [DataObjectField(false, false, false, 20)]
        [BindColumn(3, "A_Name", "地区名", null, "nvarchar(20)", 0, 0, true)]
        public String A_Name
        {
            get { return _A_Name; }
            set { if (OnPropertyChanging("A_Name", value)) { _A_Name = value; OnPropertyChanged("A_Name"); } }
        }

        private String _A_Pinyin;
        /// <summary>拼音</summary>
        [DisplayName("拼音")]
        [Description("拼音")]
        [DataObjectField(false, false, false, 100)]
        [BindColumn(4, "A_Pinyin", "拼音", null, "varchar(100)", 0, 0, false)]
        public String A_Pinyin
        {
            get { return _A_Pinyin; }
            set { if (OnPropertyChanging("A_Pinyin", value)) { _A_Pinyin = value; OnPropertyChanged("A_Pinyin"); } }
        }

        private Int32 _A_ShowOrder;
        /// <summary>显示顺序</summary>
        [DisplayName("显示顺序")]
        [Description("显示顺序")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn(5, "A_ShowOrder", "显示顺序", "0", "int", 10, 0, false)]
        public Int32 A_ShowOrder
        {
            get { return _A_ShowOrder; }
            set { if (OnPropertyChanging("A_ShowOrder", value)) { _A_ShowOrder = value; OnPropertyChanged("A_ShowOrder"); } }
        }

        private Int32 _A_Level;
        /// <summary>当前分类所在层数</summary>
        [DisplayName("当前分类所在层数")]
        [Description("当前分类所在层数")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn(6, "A_Level", "当前分类所在层数", null, "int", 10, 0, false)]
        public Int32 A_Level
        {
            get { return _A_Level; }
            set { if (OnPropertyChanging("A_Level", value)) { _A_Level = value; OnPropertyChanged("A_Level"); } }
        }

        private Int32 _A_ChildCount;
        /// <summary>当前分类子分类数</summary>
        [DisplayName("当前分类子分类数")]
        [Description("当前分类子分类数")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn(7, "A_ChildCount", "当前分类子分类数", null, "int", 10, 0, false)]
        public Int32 A_ChildCount
        {
            get { return _A_ChildCount; }
            set { if (OnPropertyChanging("A_ChildCount", value)) { _A_ChildCount = value; OnPropertyChanged("A_ChildCount"); } }
        }

        private Int32 _A_Delete;
        /// <summary>是否删除1:是0:否</summary>
        [DisplayName("是否删除1:是0:否")]
        [Description("是否删除1:是0:否")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn(8, "A_Delete", "是否删除1:是0:否", null, "tinyint", 3, 0, false)]
        public Int32 A_Delete
        {
            get { return _A_Delete; }
            set { if (OnPropertyChanging("A_Delete", value)) { _A_Delete = value; OnPropertyChanged("A_Delete"); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "A_Id": return _A_Id;
                    case "A_ParentID": return _A_ParentID;
                    case "A_Name": return _A_Name;
                    case "A_Pinyin": return _A_Pinyin;
                    case "A_ShowOrder": return _A_ShowOrder;
                    case "A_Level": return _A_Level;
                    case "A_ChildCount": return _A_ChildCount;
                    case "A_Delete": return _A_Delete;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "A_Id": _A_Id = Convert.ToInt32(value); break;
                    case "A_ParentID": _A_ParentID = Convert.ToInt32(value); break;
                    case "A_Name": _A_Name = Convert.ToString(value); break;
                    case "A_Pinyin": _A_Pinyin = Convert.ToString(value); break;
                    case "A_ShowOrder": _A_ShowOrder = Convert.ToInt32(value); break;
                    case "A_Level": _A_Level = Convert.ToInt32(value); break;
                    case "A_ChildCount": _A_ChildCount = Convert.ToInt32(value); break;
                    case "A_Delete": _A_Delete = Convert.ToInt32(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得地区信息字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>编号</summary>
            public static readonly FieldItem A_Id = Meta.Table.FindByName("A_Id");

            ///<summary>上级编号</summary>
            public static readonly FieldItem A_ParentID = Meta.Table.FindByName("A_ParentID");

            ///<summary>地区名</summary>
            public static readonly FieldItem A_Name = Meta.Table.FindByName("A_Name");

            ///<summary>拼音</summary>
            public static readonly FieldItem A_Pinyin = Meta.Table.FindByName("A_Pinyin");

            ///<summary>显示顺序</summary>
            public static readonly FieldItem A_ShowOrder = Meta.Table.FindByName("A_ShowOrder");

            ///<summary>当前分类所在层数</summary>
            public static readonly FieldItem A_Level = Meta.Table.FindByName("A_Level");

            ///<summary>当前分类子分类数</summary>
            public static readonly FieldItem A_ChildCount = Meta.Table.FindByName("A_ChildCount");

            ///<summary>是否删除1:是0:否</summary>
            public static readonly FieldItem A_Delete = Meta.Table.FindByName("A_Delete");
        }
        #endregion
    }

    /// <summary>地区信息接口</summary>
    public partial interface Iapp_AreaInfo
    {
        #region 属性
        /// <summary>编号</summary>
        Int32 A_Id { get; set; }

        /// <summary>上级编号</summary>
        Int32 A_ParentID { get; set; }

        /// <summary>地区名</summary>
        String A_Name { get; set; }

        /// <summary>拼音</summary>
        String A_Pinyin { get; set; }

        /// <summary>显示顺序</summary>
        Int32 A_ShowOrder { get; set; }

        /// <summary>当前分类所在层数</summary>
        Int32 A_Level { get; set; }

        /// <summary>当前分类子分类数</summary>
        Int32 A_ChildCount { get; set; }

        /// <summary>是否删除1:是0:否</summary>
        Int32 A_Delete { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}